from django.db import models

# Create your models here.

class Business(models.Model):
    bid = models.AutoField(primary_key=True,default=1)
    caption = models.CharField(max_length=60)
    code = models.CharField(max_length=30,default='SA',null=True)
    dollars = models.ForeignKey("Salary",on_delete='')
class Salary(models.Model):
    department=models.CharField(max_length=30)
    salary = models.IntegerField()
class Host(models.Model):
    nid = models.AutoField(primary_key=True)
    name = models.CharField(max_length=30,db_index=True)
    ip = models.GenericIPAddressField(protocol='ipv4',db_index=True)
    port = models.IntegerField()
    business = models.ForeignKey(to="Business",to_field='bid',on_delete='')


class Application(models.Model):
    name = models.CharField(max_length=32)
    r = models.ManyToManyField("Host")






